//
//  IMTModel.h
//  LinePhoto
//
//  Created by Kyle on 14-4-13.
//  Copyright (c) 2014年 孙凯旋. All rights reserved.
//

#import <UIKit/UIKit.h>

/****系统枚举常量定义*****/
typedef NS_ENUM(NSInteger, RequestType) {

    //账号
    RequestTypeLogin = 1, //用户登录
    RequestTypeLogout,
    RequestTypeRegister, //用户注册
    RequestTypeEditUserInfo, //修改用户信息
    RequestTypeGetUserInfo, //获取用户信息
    RequestTypeUploadUserAvatar,
    RequestTypeEditPassword, //修改密码
    RequestTypeForgetPassword, //忘记密码
    RequestTypeGetCheckinState,
    RequestTypeCheckin,
    RequestTypeGetUnReadMessageCount,
    RequestTypeGetTypeUserList,

    //车辆
    RequestTypeAddCar, //添加车辆
    RequestTypeGetCarList, //获取车辆列表
    RequestTypeDeleteCar, //删除车辆
    RequestTypeEditCarName, //修改车辆名称
    RequestTypeLockCar, //锁定车辆
    RequestTypeLockCarRange, //锁定车辆范围
    RequestTypeUnlockCarRange, //解锁车辆范围
    RequestTypeGetMyPath, //获取我的路径
    RequestTypeGetLatestGPSInfo, //获取车辆最近一次位置
    RequestTypeApproveCarOwner,
    RequestTypeGetCarRankingList,
    RequestTypeGetMyCarRankingList,
    RequestTypeGetCarRankingAward,
    RequestTypeReceiveCarRankingAward,
    RequestTypeGetCarRankingWeekList,
    RequestTypeGetMyCarRankingWeekList,
    RequestTypeGetCarRankingWeekAward,
    RequestTypeReceiveCarRankingWeekAward,
    RequestTypeGetOwnCarList,
    RequestTypeDeleteOwnCar,
    RequestTypeUpdateFirmware,
    RequestTypeActivateCar,
    RequestTypeGetAgentShopName,
    RequestTypeIsCarActivated,
    RequestTypeAddVXCarStatistics, // 车辆骑行记录添加
    RequestTypeGetVXCarStatistics, // 车辆骑行记录获取
    RequestTypeGetVXCarStatisticsIndex, // 车辆骑行记录最新下标


    //录制动作
    RequestTypeAddCarAction, //添加录制的动作
    RequestTypeGetCarActionList, //获取动作列表
    RequestTypeDeleteCarAciton, //删除动作

    //售后
    RequestTypeAddCarProblem, //添加产品维护信息
    RequestTypeGetCarProblemList, //获取产品维护列表
    RequestTypeGetCarProblemDetail, //获取产品维护详情
    RequestTypeAddProblemMessage, //发送咨询消息

    //精选
    RequestTypeAddPost,
    RequestTypeDeletePost,
    RequestTypeGetHotPostList,
    RequestTypeGetLatestPostList,
    RequestTypeGetPostListWithUserId,
    RequestTypeLikePost,
    RequestTypeCancelLikePost,
    RequestTypeGetPostCommentList,
    
    RequestTypeGetPostRewardList,
    
    RequestTypeGetPostDetail,
    RequestTypeGetPostLikeList,
    RequestTypeAddPostComment,
    RequestTypeDeletePostComment,
    RequestTypeAddAttachment,
    RequestTypeGetUnReadCommentAndLikeList,
    RequestTypeGetTopicList,

    //任务
    RequestTypeGetTaskList,
    RequestTypeGetJoinedTaskList,
    RequestTypeGetFinishedTaskList,
    RequestTypeGetTaskUserList,
    RequestTypeGetTaskDetail,
    RequestTypeJoinTask,
    RequestTypeQuitTask,
    RequestTypeFinishTask,
    RequestTypeGetNearbyUserList,
    RequestTypeGetNearbyTaskList,
    RequestTypeGetPublishedTaskList,

    //其他
    RequestTypeAddFeedback, //提交意见反馈
    RequestTypeGetCommonProblem, //获取常见问题
    RequestTypeGetAttentionMatter, //获取注意事项
    RequestTypeGetProductIntroduction, //获取产品说明
    RequestTypeGetDeclaration, //获取条款协议
    RequestTypeGetAboutCompany, //关于乐行天下
    RequestTypeCheckUpdate, //检查更新
    RequestTypeGetAdvertisementList, //获取广告
    RequestTypeAddPhoneGPS,
    RequestTypeGetMileageAward,
    RequestTypeAddCarStatistics,
    RequestTypeDownloadFile,

    //兑换物品
    RequestTypeGetExchangeItemCategoryList,
    RequestTypeGetExchangeItemList,
    RequestTypeGetExchangeItemDetail,
    RequestTypeBuyExchangeItem,
    RequestTypeGetMyExchangeItemList,
    RequestTypeGetCarFunctionList,
    RequestTypeGetCarFunctionDetail,
    RequestTypeBuyCarFunction,
    RequestTypeGetMyCarFunctionList,
    RequestTypeGetCurrentCarFunctionList,

    //小纸条
    RequestTypeGetConversationList,
    RequestTypeGetMessageList,
    RequestTypeSendMessage,

    //随手画
    RequestTypeGetMyPaintList,
    RequestTypeAddPaint,
    RequestTypeDeletePaint,
    RequestTypeEditPaintName,

    //音乐
    RequestTypeGetMusicPackageList,
    RequestTypeGetMusicPackageDetail,
    RequestTypeBuyMusicPackage,
    RequestTypeGetMyMusicPackageList,

    //Goods
    RequestTypeGetGoodsCategoryList,
    RequestTypeGetGoodsList,
    RequestTypeGetGoodsDetail,
    RequestTypeBuyGoods,
    RequestTypeGetMyGoodsList,
    RequestTypeGetMyOrderList,
    RequestTypeCheckCoupon,
    RequestTypeSubmitOrder,
    RequestTypeGetExpressAddress,
    RequestTypeCancelGoodsOrder,
    RequestTypeGetGoodsOrder,
    RequestTypeSubmitWXPayPrepayOrder,
    RequestTypeGetGoodsOrderPayStatus,
    
    //Coach
    RequestTypeGetCoachInfo,
    RequestTypeGetMyRecommendCoachList,
    RequestTypeApplyForCoach,
    RequestTypeGetCouponCodeList,
    RequestTypeGenerateCouponCode,
    RequestTypeGetBillList,
};

typedef NS_ENUM(NSInteger, MapType) {
    MapTypeGPS = 0,
    MapTypeApple,
    MapTypeGoogle,
    MapTypeAutoNav,
};

@interface IMTModel : NSObject <NSCoding>

@property(nonatomic) RequestType requestType;

//通过请求加载数据
- (void)loadDataFromResponseData:(id)responseData andRequestType:(RequestType)requestType;

- (NSString *)stringFromResponseData:(id)responseData;

+ (NSString *)stringFromResponseData:(id)responseData;

- (BOOL)boolFromResponseData:(id)responseData;

+ (BOOL)boolFromResponseData:(id)responseData;

- (id)initWithCoder:(NSCoder *)aDecoder;

- (void)encodeWithCoder:(NSCoder *)aCoder;

//加载本地数据
- (void)loadCache;

//保存数据到本地
- (void)saveCacheWithResponseData:(NSMutableDictionary *)responseData;

@end
